package com.huawei.M01.iterator;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class MD5 {
    public static void main(String[] args) throws NoSuchAlgorithmException {
        String input = "itBaiZhan";
        String algorithm = "MD5";
        MessageDigest instance = MessageDigest.getInstance(algorithm);

        byte[] digest = instance.digest(input.getBytes());

        System.out.println(new String(Base64.getEncoder().encode(digest)));
    }
}
